﻿@model ActionTrackerEntities.Usuario

@{
    ViewBag.Title = "Editar Usuario | Action Tracker";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@section script
{
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>        
    <script src="@Url.Content("~/Scripts/jquery.ui.datepicker-es.js")" type="text/javascript"></script>    
}

@using (Html.BeginForm("Edit", "Usuario", FormMethod.Post, new { id = Model.IdUsuario }))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Editar usuario</legend>
         @Html.HiddenFor(x => x.IdUsuario)
         @Html.HiddenFor(x=> x.Password)
        <div class="control-group">
            @Html.LabelFor(model => model.Nombre)
            <div class="controls">
                @Html.EditorFor(model => model.Nombre)
                @Html.ValidationMessageFor(model => model.Nombre)
            </div>
        </div>
        
        @*<div class="control-group">
             @Html.LabelFor(model => model.Password)
            <div class="controls">
               @Html.EditorFor(model => model.Password)
            @Html.ValidationMessageFor(model => model.Password)
            </div>
        </div>*@
        
        <div class="control-group">
            @Html.LabelFor(model => model.TipoUsuario)
            <div class="controls">
                @Html.DropDownListFor(model => model.TipoUsuario, (SelectList)ViewData["TiposUsuario"], "(Seleccione)")
                @Html.ValidationMessageFor(model => model.TipoUsuario)
            </div>
        </div>
        <p>
            <input type="submit" value="Guardar" class="btn btn-primary"/>
        </p>
    </fieldset>
}
<div>
    @Html.ActionLink("Volver", "Index")
    @Html.ActionLink("Atras", "Create")
</div>
